import sys
import os
import logging

from google.appengine.ext.webapp.util import run_wsgi_app


templatepath = os.path.join( os.path.dirname(__file__), "templates" )

googlemapkey="ABQIAAAAdlGyR5spzXIbhIAKXdMESBQVGpoJO8ib3Kg7Z_TBVRJ3VogelhRX7FBnIYp1gjHEL8nD4AGKxq8i1A"


#sys.path = [ sys.path[0] + "/lib" ] + sys.path

os.environ['DJANGO_SETTINGS_MODULE'] = 'djsettings'

# Make sure we can import Django.  We may end up needing to do this
# little dance, courtesy of Google third-party versioning hacks.  Note
# that this patches up sys.modules, so all other code can just use
# "from django import forms" etc.
try:
  from django import v0_96 as django
except ImportError:
  pass

#controllers
import controllers.mainpage
import controllers.myjourney
import controllers.waypoints
import controllers.error
import controllers.wptypes
import controllers.regions

import lib.webapp as webapp
from lib.webapp import app

webapp.setTemplatePath( templatepath )
webapp.setGMapKey( googlemapkey )

def main():
    logging.getLogger().setLevel(logging.DEBUG)
    run_wsgi_app(app())
    pass
    
if __name__ == "__main__":
  main()

